# requests
# 导入模块
import requests

# 发送请求,获取响应
response = requests.get('http://www.baidu.com')
print(response)  # 200

# 获取响应数据

# print(response.encoding)  # 打印编码 默认 ISO-8859-1
# response.encoding = 'utf8'
# print(response.text)  # 输出内容

print(response.content.decode(encoding='utf8'))  # 获取二进制数据并解码
